﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Honestysoft.Financing.Model
{
    public partial class Bu_AuditBatch
    {
        /// <summary>
        /// 批次合同
        /// </summary>
        public List<Bu_BatchContract> BatchContracts { get; set; }
        /// <summary>
        /// 批次接收表
        /// </summary>
        public List<Bu_BatchRec> BatchRecs { get; set; }

        /// <summary>
        /// 包含的合同
        /// </summary>
        public List<string> ContractIDList
        {
            get
            {
                List<string> lsID = new List<string>();
                if (BatchContracts != null)
                {
                    foreach (Bu_BatchContract item in BatchContracts)
                    {
                        if (!lsID.Contains(item.ContractID))
                        {
                            lsID.Add(item.ContractID);
                        }
                    }
                }
                if (BatchRecs != null)
                {
                    foreach (Bu_BatchRec item in BatchRecs)
                    {
                        if (!lsID.Contains(item.ContractID))
                        {
                            lsID.Add(item.ContractID);
                        }
                    }
                }
                if (lsID.Count == 0) { return null; }
                return lsID;
            }
        }
    }
}
